package com.smartaccounting.model;

import java.math.BigDecimal;
import java.time.LocalDateTime;

public class Budget {
    private int budgetId;
    private int userId;
    private String category;
    private BigDecimal amount;
    private String monthYear; // 格式: YYYY-MM
    private LocalDateTime createdAt;
    private LocalDateTime updatedAt;

    // 无参构造方法
    public Budget() {}

    // 全参构造方法
    public Budget(int budgetId, int userId, String category, BigDecimal amount,
                  String monthYear, LocalDateTime createdAt, LocalDateTime updatedAt) {
        this.budgetId = budgetId;
        this.userId = userId;
        this.category = category;
        this.amount = amount;
        this.monthYear = monthYear;
        this.createdAt = createdAt;
        this.updatedAt = updatedAt;
    }

    // 添加预算用构造方法
    public Budget(int userId, String category, BigDecimal amount, String monthYear) {
        this.userId = userId;
        this.category = category;
        this.amount = amount;
        this.monthYear = monthYear;
    }

    // Getter 和 Setter 方法
    public int getBudgetId() {
        return budgetId;
    }

    public void setBudgetId(int budgetId) {
        this.budgetId = budgetId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public BigDecimal getAmount() {
        return amount;
    }

    public void setAmount(BigDecimal amount) {
        this.amount = amount;
    }

    public String getMonthYear() {
        return monthYear;
    }

    public void setMonthYear(String monthYear) {
        this.monthYear = monthYear;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }

    public LocalDateTime getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(LocalDateTime updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Override
    public String toString() {
        return "Budget{" +
                "budgetId=" + budgetId +
                ", userId=" + userId +
                ", category='" + category + '\'' +
                ", amount=" + amount +
                ", monthYear='" + monthYear + '\'' +
                '}';
    }
}